{% extends "common/default.html" %}
{% block common %}
    <script type="text/javascript">
        function checkForm() {
            var userName = $("#userName").val();
            var password = $("#password").val();
            var trueName = $("#trueName").val();
            var stuNo = $("#stuNo").val();
            var professional = $("#professional").val();
            if (userName == null || userName == "") {
                $("#error").html("用户名不能为空！");
                return false;
            }
            if (password == null || password == "") {
                $("#error").html("密码不能为空！");
                return false;
            }
            if (trueName == null || trueName == "") {
                $("#error").html("真实姓名不能为空！");
                return false;
            }
            if (stuNo == null || stuNo == "") {
                $("#error").html("学号不能为空！");
                return false;
            }
            if (professional == null || professional == "") {
                $("#error").html("专业不能为空！");
                return false;
            }
            return true;
        }

        function resetValue() {
            window.location.href = "../main/student_select_showInfo";
        }
    </script>
    <div class="panel panel-default">
        <div class="panel-heading">
            <h3 class="panel-title">个人信息</h3>
        </div>
        <div class="panel-body">
            <form class="form-horizontal" role="form" method="post" action="../update">
                {%  if  success %}
                    <label style="background-color: #3e8f3e">{{ success }}</label>
                    {% elif erro %}
                    <label style="background-color: red">{{ success }}</label>
                {% endif %}
                <div class="form-group">
                    <label class="col-md-2 control-label">密码：</label>
                    <div class="col-md-10">
                        <input type="text" class="form-control" id="password" name="password" style="width: 300px;"
                               value="{{ user.password }}">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-md-2 control-label">真实姓名：</label>
                    <div class="col-md-10">
                        <input type="text" class="form-control" id="trueName" name="trueName" style="width: 300px;"
                               value="{{ user.trueName }}">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-md-2 control-label">学号：</label>
                    <div class="col-md-10">
                        <input type="text" class="form-control" id="stuNo" name="stuNo" style="width: 300px;"
                               value="{{ user.stuNo }}" readonly="readonly">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-md-2 control-label">专业：</label>
                    <div class="col-md-10">
                        <input type="text" class="form-control" id="professional" name="professional"
                               style="width: 300px;" value="{{ user.professional }}">
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-offset-2 col-sm-10">
                        <input type="hidden" id="id" name="id" value="${teacher.id }"/>
                        <button type="submit" class="btn btn-primary">保存</button>&nbsp;&nbsp;
                        <font color="red" id="error"></font>
                    </div>
                </div>
            </form>
        </div>
    </div>
{% endblock %}

